﻿@using SESM.DAL
@model SESM.Models.Views.Backup.BackupViewModel
@{
    ViewBag.Title = "Backup List";
    List<SelectListItem> listDir = (List<SelectListItem>)ViewData["listDir"];
    int id = (int)ViewData["ID"];
    AccessLevel accessLevel = (AccessLevel)ViewData["AccessLevel"];
}
<div class="row">
    @using (Html.BeginForm("Index", "Backup", null, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
    {
        <div class="col-md-6">
            <div class="well">
                @Html.ValidationSummary()
                <div class="form-group">
                    @Html.DropDownListFor(m => m.BackupName, listDir, new { @class = "form-control center-block", size = "15", style = "max-width:none;width:94%" })
                    @Html.ValidationMessageFor(m => m.BackupName)
                </div>

                <div style="text-align: center;">
                    <div class="btn-group">
                        <input type="submit" onclick=" return confirm('If a map with the same name as the bacuped one exist, it will be overwriten. If the overwriten map is in use, the server will be restarted. Are you sure you want to do this ?'); " value="Restore" name="action:RestoreBackup" class="btn btn-primary">
                        <input type="submit" value="Download" name="action:DownloadBackup" class="btn btn-success">
                        <input type="submit" onclick=" return confirm('This will delete this backup. Are you sure you want to do this ?'); " value="Delete" name="action:DeleteBackup" class="btn btn-danger">
                    </div>
                </div>
            </div>
        </div>
    }
</div>
<div class="row">
    <div class="col-md-12">
        <a class="btn btn-default" href="@(Url.Action("Status", "Server", new {id = ViewData["ID"]}))">
            <span class="glyphicon glyphicon-chevron-left"></span> Back to Server Status
        </a>
    </div>
</div>